package cn.gson.springboot.model.dao;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.alibaba.fastjson.JSONArray;

import cn.gson.springboot.model.pojos.Ck;


public interface CkDAO extends CrudRepository<Ck, Integer>{
	//2)按id查询
	@Query("select e.drugsBatchKc from Ck e where e.drugsYk.drugId=?1")
	public List<Integer> cxpc(int a); 
	
	@Query("select e from Ck e where e.drugsYk.drugId=?1 and e.drugsBatchKc=?2")
	public Ck kmcx(int a,int b); 
	
	@Query("select e from Ck e where e.drugsYk.drugId=?1 and e.drugsBatchKc=?2")
	public Ck kmpccx(int a,int b); 
	
	@Query("select e from Ck e where e.drugsYk.drugId=?1 and e.drugsBatchKc=?2")
	public JSONArray kmpccxsy(int a,int b); 
//	
//	//2)模糊查询
//	public List<QuestionInfo> findByQuestionLike(String a);
	
//	@Query("UPDATE ck set ck.drugs_Stock_kc =ck.drugs_Stock_kc-?1 where ck.drug_id=?2")
//	public void fankuxg(int a,int b);
}  
